UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gUttmUAlDra/ondvYB+Yf1JSW4qsT/A0mZf3KUz8L+Y='
WHERE
key_id = '72243ecb1f831b234af2bb2bf7bc32414433b640aff4ffb15ed3cb0bb62783cc'
AND (
token = 'gUttmUAlDra/ondvYB+Yf1JSW4qsT/A0mZf3KUz8L+Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)