UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hfidle+4V6/0WJmy+Pd4TKRbueA+xBXcnuJkLSZNzQY=' 
WHERE 
  key_id = 'cffd279ff725b8dda47640bb4c9073be706bb9103ecac6eee91941ef527fc7c3' 
  AND (
    token = 'Hfidle+4V6/0WJmy+Pd4TKRbueA+xBXcnuJkLSZNzQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028