UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '66VWCvNWE9nrlV3JRaUb1gkRxw5eWU/sJDs3cLgdvaM=' 
WHERE 
  key_id = 'b2f4aadc9a0cf46ac1be1c95a60f20c02c00d664bd71067b8e2ae0df4aa31478' 
  AND (
    token = '66VWCvNWE9nrlV3JRaUb1gkRxw5eWU/sJDs3cLgdvaM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049