UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PdNGFhSXAenrbPnWhgiX02DpSoq7zDo5eybgnwijaMk='
WHERE
key_id = '45767366dfc73ea21a75db8c0fd3aa560b8048ed9cd510ae90660bec1e7c4872'
AND (
token = 'PdNGFhSXAenrbPnWhgiX02DpSoq7zDo5eybgnwijaMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)