UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HSSB2j9WT0E6ZPqk9wGzRYelckO7cosL1VHsMXcHxIA='
WHERE
key_id = '73178ffe66e18f098ecdfb27b6828c096e3a4e3aba5c1ad04ea4c7422c77739a'
AND (
token = 'HSSB2j9WT0E6ZPqk9wGzRYelckO7cosL1VHsMXcHxIA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)