UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rjIPhF3JV7rF0xVorF9KPrkUmnCW3XTwE9rlLfzhJ1E=' 
WHERE 
  key_id = '283e79a527e8e1404bb7542522a710c19c62d22473cbcb3ff23af389d75fe00c' 
  AND (
    token = 'rjIPhF3JV7rF0xVorF9KPrkUmnCW3XTwE9rlLfzhJ1E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053