UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8rYEo/z5hfRoDvKfMny3crvNap2QorugP7PUcpaQaaQ='
WHERE
key_id = '36677ce448898aba1e87efebeee56d441e343a8bff71fa021c245a455ba7711e'
AND (
token = '8rYEo/z5hfRoDvKfMny3crvNap2QorugP7PUcpaQaaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)