UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4AgC/S4y8UaFIFdn+HVdiC1759atSNyrD3G4mEA0qAM='
WHERE
key_id = '552681dac01bdb004111df850f7d1e70858117cae7d20758e8a131c446ecbdfe'
AND (
token = '4AgC/S4y8UaFIFdn+HVdiC1759atSNyrD3G4mEA0qAM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)