UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vWW6IxJciRmRA9wHYkmjjD7uGVcX898Cihxsv1Hr6z4='
WHERE
key_id = 'df57c91990e3d26af29c69cc00b4f1d5f693ebbcdd36be245869a9da31bade55'
AND (
token = 'vWW6IxJciRmRA9wHYkmjjD7uGVcX898Cihxsv1Hr6z4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)