UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CrLLqwXBYErMXqMD8XabXh/EzvwPgkfnzoUzc7/3HNQ='
WHERE
key_id = '84643f822ffa95e75ec725fd97f0e23508418f1ab3e2145359d3dc50dbd3795d'
AND (
token = 'CrLLqwXBYErMXqMD8XabXh/EzvwPgkfnzoUzc7/3HNQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)