UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AdfTNRA/aCY1eNLLPmOYV8xh9ZH5s11LbCB502V3Ums='
WHERE
key_id = '2093b467da694ba428f617877129e90eef8c881921f0e1b2fc26580328020b84'
AND (
token = 'AdfTNRA/aCY1eNLLPmOYV8xh9ZH5s11LbCB502V3Ums='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)