UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oiiS5YBtDqFqboehJSW0HS1t5jkW1rFsp7UiKUQouMQ='
WHERE
key_id = '4ee7bd13faa88dd55eb2e700096b3e176a5593cb81e5dc1048d5f41dfd28179a'
AND (
token = 'oiiS5YBtDqFqboehJSW0HS1t5jkW1rFsp7UiKUQouMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)