UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tJTQmvB/NKoBhGp+kiZruYz2tLMT7WbUW9KxeZmYqTs='
WHERE
key_id = '2646701ac69f1836ac19cf316669a0e145f17bd5f4689bfb4b45d9bde3470db6'
AND (
token = 'tJTQmvB/NKoBhGp+kiZruYz2tLMT7WbUW9KxeZmYqTs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)