UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OTf7jnvX5MLzhJtA3iz8rnA6REUmBkK36vHCk6/7ONY='
WHERE
key_id = 'bb07e6242525f28c0d8f385bb201ad77065c17b24b95bebc1ef4d395171def1c'
AND (
token = 'OTf7jnvX5MLzhJtA3iz8rnA6REUmBkK36vHCk6/7ONY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)