UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'smKctVmEzEMx2HBc60oLIywkTWCq2PjQ9FIJYQM+tA0='
WHERE
key_id = '215d83c686cb1984b87e3d808630cfd8ce17f45642a82a91516371311a1fad7f'
AND (
token = 'smKctVmEzEMx2HBc60oLIywkTWCq2PjQ9FIJYQM+tA0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)