UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w8T5vpPORMkY3FyhtzSA4oZfbM17anNHyLonbBqD6sA='
WHERE
key_id = '293eef45b3f5c1e40a0c7db8788bc26a233161b94e1b67a2b44f97f7380d5940'
AND (
token = 'w8T5vpPORMkY3FyhtzSA4oZfbM17anNHyLonbBqD6sA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)