UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't0MIdionLteKQc28JBIVP/o3MENCrsmPT3UTVSwvzVA='
WHERE
key_id = '332d9da870598bfbe3324830f882de309fdf841e99976172b4644d9bf200eca2'
AND (
token = 't0MIdionLteKQc28JBIVP/o3MENCrsmPT3UTVSwvzVA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)