UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k04hYFjv0jzwcYjGrjvd52FqBBvN+9rRlxX/U7pLDq0='
WHERE
key_id = '61e947fd5f5096cf84a9ac0c1d4500f7fbf352f84cee11413e54faabc08e015c'
AND (
token = 'k04hYFjv0jzwcYjGrjvd52FqBBvN+9rRlxX/U7pLDq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)