UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JPnBPLD1T7pwJnC0C9c1ySo8NbA1Rit653om7b0Ti6M=' 
WHERE 
  key_id = '2500def5f4af765619dc96d4fcf0b3015e78f208c573a0fea269174f28f5e192' 
  AND (
    token = 'JPnBPLD1T7pwJnC0C9c1ySo8NbA1Rit653om7b0Ti6M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051