UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gTbdcg2CInkFZmOsf3DnSVfY74V3z94fIqJo53ZMc08='
WHERE
key_id = '6b17e6d3e210e80a5652698de1ae77dbcd6f0828538b6a18f0c942a85e88ba85'
AND (
token = 'gTbdcg2CInkFZmOsf3DnSVfY74V3z94fIqJo53ZMc08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)