UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MjGsW0sLD3K+ylDa28l6RLK7BPp/+FuMAj9C4cnLnZY='
WHERE
key_id = '35cfca983c6e31d6194bb7d0934a02598af2d216314a921eada7d2d18e15f9d8'
AND (
token = 'MjGsW0sLD3K+ylDa28l6RLK7BPp/+FuMAj9C4cnLnZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)