UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2IgfufCfwp6zaAO5byf86pZFplnSFBsUrWGYd/RYcbk=' 
WHERE 
  key_id = '9273f673d60d4ecb646066556f0f42c242011e3442d7eeaeffe5e8b4764b8ab5' 
  AND (
    token = '2IgfufCfwp6zaAO5byf86pZFplnSFBsUrWGYd/RYcbk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027