UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DnIo/weDFER1N1MfMWaKy6kh7Q0eIyLWCSiahC/CUYg=' 
WHERE 
  key_id = '02df12305fded01d969186d584a1fae92e28e690b59d124fe0603e1e8a8850ec' 
  AND (
    token = 'DnIo/weDFER1N1MfMWaKy6kh7Q0eIyLWCSiahC/CUYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063