UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c7vz3TRN1z+xdp+O32DgdWZzcq2Q5WRf8CfUSDQrsSc='
WHERE
key_id = 'ba8abf91224936f7b55df10d075fbcc9c3186968f81d3de64aec5d4ef932728b'
AND (
token = 'c7vz3TRN1z+xdp+O32DgdWZzcq2Q5WRf8CfUSDQrsSc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)