UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LNUmnNiAYCgUDxGVHB4aJnJVr6Ur8em7cNoF8ohGDWo=' 
WHERE 
  key_id = '0a4a0f6191716ec93c754669c4b69e88eb7d9641e3cce3c9f98207750d87f1b1' 
  AND (
    token = 'LNUmnNiAYCgUDxGVHB4aJnJVr6Ur8em7cNoF8ohGDWo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030