UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '46HCpTFmsmaUfKXDBiJAXA878wg9liK+EdR9753kDaA=' 
WHERE 
  key_id = '10fba3b9c08626aea6f70bbec1a3d6a51ec3c1458616626362408fb4e3a1cec0' 
  AND (
    token = '46HCpTFmsmaUfKXDBiJAXA878wg9liK+EdR9753kDaA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032