UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TXWXIQBiyXRFNjgZAubWw5sKxf0FnJZ6ck1K3eojkDw='
WHERE
key_id = 'ce7b2b5ccea3377f3b92647a6d9bff8b692919647b9a62b67ef5be82a07d474e'
AND (
token = 'TXWXIQBiyXRFNjgZAubWw5sKxf0FnJZ6ck1K3eojkDw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)