UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RwwR1s6fhkuCisxixLGnWPwV7mBL2FALREIwzXgi61g=' 
WHERE 
  key_id = '5f3c9d45d066f421514e62d4262c5141eaccd87c7ce948fbe218cc8d037d58c8' 
  AND (
    token = 'RwwR1s6fhkuCisxixLGnWPwV7mBL2FALREIwzXgi61g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033