UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e74X9y97oa0eIufK0ETje+6SycnSqD/CL5FTt8oEhZM=' 
WHERE 
  key_id = '584a7bd093617cfee386e96afcd715ebf1a2d1ad4da95d39ab49ff3790dd5244' 
  AND (
    token = 'e74X9y97oa0eIufK0ETje+6SycnSqD/CL5FTt8oEhZM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00087