UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/9yl6XKhnZh7HrbPtohtQIgJwrodW1Id8nilB9SuTw0=' 
WHERE 
  key_id = '6758b9982ec83d4bf9e624013ad6dffb5a6786841f103a5dcf550a96731a4101' 
  AND (
    token = '/9yl6XKhnZh7HrbPtohtQIgJwrodW1Id8nilB9SuTw0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035