UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L6dmJSt/tJRFDjSXSjCGBcHXV83A0gDQn8qewdCyaw8=' 
WHERE 
  key_id = '2027f02b328e932857549375ca891342c024a0568fa6a356ac9b3e0c15cb0b53' 
  AND (
    token = 'L6dmJSt/tJRFDjSXSjCGBcHXV83A0gDQn8qewdCyaw8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021