UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SmGz0XDO3So6qEZxuVevsgR0w/Z3HFd93OTpEc48G28=' 
WHERE 
  key_id = '709c23a39b8b51451a67cb1e7e66c74c9ab8b168892ad66f7cb635378050fe09' 
  AND (
    token = 'SmGz0XDO3So6qEZxuVevsgR0w/Z3HFd93OTpEc48G28=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053