UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QMWdp60PI6zGVNRDCbG0+kk5sHODspopuoVeEVPWJNs='
WHERE
key_id = '666c2134653c5ddc8a8ef3f05fac93b93e98baafa1c51b3f2682221b834c6a85'
AND (
token = 'QMWdp60PI6zGVNRDCbG0+kk5sHODspopuoVeEVPWJNs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)