UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q6b2tUShfCI8JM9P9s4zXlHlqIygA+d+C8RCnRmvb9k='
WHERE
key_id = 'a0c8f203c1aca39525f0757e38fd37b2d6ff2d05cb2cd0544e15ee0dd42e679d'
AND (
token = 'Q6b2tUShfCI8JM9P9s4zXlHlqIygA+d+C8RCnRmvb9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)