UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9BcZz/ZDbj6F9+RMAFFeX2EL73NAjTvVABybkc70M0I=' 
WHERE 
  key_id = '53cfccf8f75e2c0c618f92010498fe971f6d8d314616e451232f00b8e3ca18b7' 
  AND (
    token = '9BcZz/ZDbj6F9+RMAFFeX2EL73NAjTvVABybkc70M0I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014