UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ppqov4+HfQ6BXG72oXbCJHnW39En0VKIi3mj4RQJkG0='
WHERE
key_id = 'bca5b879bb73be2e2fcfc5aef712f1dd87466af641fc59a14b0b0e63934071e2'
AND (
token = 'ppqov4+HfQ6BXG72oXbCJHnW39En0VKIi3mj4RQJkG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)