UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DbVc52vbajtVlZN1P3CdUOlu1405oU4gXlfpYpEM7PE='
WHERE
key_id = '15bef16b7adf8a69f9a98d4fa5db7b1eb8b40c44a97565115484e9fb6a9db6b4'
AND (
token = 'DbVc52vbajtVlZN1P3CdUOlu1405oU4gXlfpYpEM7PE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)