UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IIvqhmZQKGSEgjb95WdSZXmDtSb9xPuXlkSioK2xPYc=' 
WHERE 
  key_id = '7a3fe6be9e01d72308b35ad5b7f1b3a39bca5fb7bb7a3294673b9b73faab273b' 
  AND (
    token = 'IIvqhmZQKGSEgjb95WdSZXmDtSb9xPuXlkSioK2xPYc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00012