UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WTpBbVJex5EvheyCsOHzAb5Jm+7OcnwDMLKhgZ3yZ9s=' 
WHERE 
  key_id = '04da2f5c0d1e938cf344f9f8cd0b89967f7f85f3704d06d28acee84c9c5e94fa' 
  AND (
    token = 'WTpBbVJex5EvheyCsOHzAb5Jm+7OcnwDMLKhgZ3yZ9s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019