UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y+MzlgnNt+vxmX03hUjauO5RoxlxQ9eUsRofhm4Nq8k='
WHERE
key_id = 'ee5276a86610cdd6030b5dbb17e563979be9ef290980481d9ed116df094db0e0'
AND (
token = 'y+MzlgnNt+vxmX03hUjauO5RoxlxQ9eUsRofhm4Nq8k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)