UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DWa2FP1/PSHMFr8JIkLz4HHHvBJznfPGbIQMGgNBilo='
WHERE
key_id = 'd955a2d386596760b8c14394e8f98fa356e274c23223ee4107732c15023a8a29'
AND (
token = 'DWa2FP1/PSHMFr8JIkLz4HHHvBJznfPGbIQMGgNBilo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)