UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 're5s3As4Kpcub9hHdm12q5+ZD+TFhx5IL72e0edfB0E=' 
WHERE 
  key_id = '4ced657f650d863a794fa6e7b3dc2f0e4682e370a5e9d15bbdcda6634bd541f7' 
  AND (
    token = 're5s3As4Kpcub9hHdm12q5+ZD+TFhx5IL72e0edfB0E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031