UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/sQqGexrSu+NZqYSdZPO/NMGxSaEG8SDWy/KUWHCWNI='
WHERE
key_id = '766e1d469a07045eb880577f269f19f34c8dd2f1c2905f19678ee48092ba279c'
AND (
token = '/sQqGexrSu+NZqYSdZPO/NMGxSaEG8SDWy/KUWHCWNI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)