UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vuCfd5AGe037ySPdQ8inCWJJxOU8Ztqb8E0A32WYiVE='
WHERE
key_id = '4ec7485d3c2c3c6a8a5b9d69a9a549832f950706d7f50c18ab20d69970c3b538'
AND (
token = 'vuCfd5AGe037ySPdQ8inCWJJxOU8Ztqb8E0A32WYiVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)