UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Clj0SjD6BN3ZbsfsRjnzrkkjo2Aur+jqdYbSgvq/4iE='
WHERE
key_id = 'c0e2e4949360c5d38da049e511cfeef137ccb5bdfb98608fc15f7f48d182bc27'
AND (
token = 'Clj0SjD6BN3ZbsfsRjnzrkkjo2Aur+jqdYbSgvq/4iE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)